<h2><?= anchor('admin/emails', 'E-mails') ?> Envoi d'un e-mail groupé</h2>

<?= form_open('admin/emails/save/'.$email->id, 'class="stylized"') ?>
	<table>
		<tr>
			<td>Sujet :</td>
			<td><?= form_input('subject', $email->subject) ?></td>
		</tr>
		<tr>
			<td class="top">Message :</td>
			<td><?= form_textarea('body', $email->body) ?></td>
		</tr>
		<tr>
			<td class="top">Destinataires :</td>
			<td>
				<?php foreach ($statuses as $status) {
					$checked = in_array($status->id, $selected_statuses);
					echo form_checkbox('user_status[]', $status->id, $checked, 'id="status_'.$status->id.'"');
					echo form_label($status->label, 'status_'.$status->id).' <strong>('.$status->user_count.')</strong>';
					echo br();
				} ?>
			</td>
		</tr>
	</table>
	<br />
	<div class="button-box">
		<?= button_submit('Enregistrer et envoyer', 'email_go', 'name="email_submit" value="save_and_send"') ?>
		<?= button_submit('Enregistrer', 'disk', 'name="email_submit" value="save"') ?>
		<?= button_cancel('admin/emails') ?>
	</div>
</form>
